#ifndef TREE_H_
#define TREE_H_

typedef struct treenode{

    struct treenode * left;
    struct treenode * right;
    char value;
    int freq;

}TreeNode;

TreeNode * TreeNode_create(char value,int freq);

TreeNode * TreeNode_merge(TreeNode * tr1,TreeNode * tr2);

void Tree_print(TreeNode * tn,int level);

int countBinaryNode(TreeNode * tn);

void Tree_header(TreeNode * tn,char * outfile);

int compress(char * infile,char * outfile,int ** codebook,int * mapping);

#endif //!TREE_H_